'use strict'
// Template version: 1.2.4
// see http://vuejs-templates.github.io/webpack for documentation.
const prodEnv = require('./prod.env')
const path = require('path')
// const disposeString = (str) => {
//   return str.replace(/\"/g, "")
// }

module.exports = {
  dev: {
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {
	 '/agent': {
        // target: 'http://47.111.167.86:8002/rds-bpm-platform',
        
        // target: 'http://3.2.31.128:8080/rds/',
        // target: 'http://3.1.21.34:9001/rds/sit/',
        // target: 'http://3.2.31.136:8080/',
        
        target: 'http://3.1.13.212:16601/api/js/AssEntLoan',
        // target: 'https://pay.lnrcc.com:8060',
        // target: 'https://pay.lnrcc.com:8060/ceshi_newcode/openbank/api/js/AssEntLoan',
        // agent
        changeOrigin: true,
        pathRewrite: {'^/agent' : ''},
	   }
  },

    // Various Dev Server settings
    host: 'localhost', // can be overwritten by process.env.HOST
    // host:'192.168.0.100', // can be overwritten by process.env.HOST
    port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
    autoOpenBrowser: false,
    errorOverlay: true,
    notifyOnErrors: true,
    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-

    // Use Eslint Loader?
    // If true, your code will be linted during bundling and
    // linting errors and warnings will be shown in the console.
    useEslint: true,
    // If true, eslint errors and warnings will also be shown in the error overlay
    // in the browser.
    showEslintErrorsInOverlay: false,

    /**
     * Source Maps
     */

    // https://webpack.js.org/configuration/devtool/#development
    devtool: 'eval-source-map',

    // If you have problems debugging vue-files in devtools,
    // set this to false - it *may* help
    // https://vue-loader.vuejs.org/en/options.html#cachebusting
    cacheBusting: true,

    // CSS Sourcemaps off by default because relative paths are "buggy"
    // with this option, according to the CSS-Loader README
    // (https://github.com/webpack/css-loader#sourcemaps)
    // In our experience, they generally work as expected,
    // just be aware of this issue when enabling this option.
    cssSourceMap: false,
  },

  build: {
    // Template for index.html
    index: path.resolve(__dirname, '../dist/index.html'),

    // Paths
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    // assetsPublicPath: prodEnv[process.env.env_config] ? disposeString(prodEnv[process.env.env_config]['STATIC_BASE_URL']) + '/' : '/',
    // assetsPublicPath: '/sit_newcode/openbank/app/AssEntLoan/',  //sit
    // assetsPublicPath: '/uat_newcode/openbank/app/AssEntLoan/',  //uat
    assetsPublicPath: '/app/AssEntLoan/',  //prod

    // https://open.lnrcb.cn:8450/app/AssEntLoan/index.html


    /**
     * Source Maps
     */

    productionSourceMap: false,
    // https://webpack.js.org/configuration/devtool/#production
    devtool: '#source-map',

    // Run the build command with an extra argument to
    // View the bundle analyzer report after build finishes:
    // `npm run build --report`
    // Set to `true` or `false` to always turn it on or off
    bundleAnalyzerReport: process.env.npm_config_report
  }
}
